<%@page import="login.LoginManager"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Registro BD Digital</TITLE>
<META NAME="description"
<meta http-equiv="refresh" content="Web de registro">  
</HEAD>
<BODY BGCOLOR="#FDF5E6" TEXT="#000000" LINK="#0000EE"
VLINK="#551A8B" ALINK="#FF0000">
<CENTER>
<table BORDER=5 BGCOLOR="#EF8429">
<TR><TH CLASS="TITLE">
Introducir datos del registro de usuario</table>
</CENTER>
<P>

<%@ page import="java.util.Map, java.util.HashMap, login.LoginForm" %>



<jsp:useBean id="loginForm" scope="request" class="login.LoginForm">
   <jsp:setProperty name="loginForm" property="*" />
</jsp:useBean>

<%
//LoginManager.logout(request);
String loginNameErrorMessage = "";
String passwordErrorMessage = "";

Map errors = (Map) request.getAttribute("errors");
if (errors != null) {
String errorHeader = "<font color=\"red\"><b>";
String errorFooter = "</b></font>";
if (errors.containsKey("loginName")) {
loginNameErrorMessage = errorHeader +
errors.get("loginName") + errorFooter;
}
if (errors.containsKey("password")) {
passwordErrorMessage = errorHeader +
errors.get("password") + errorFooter;
}
}

LoginManager.logout(request);
%>

<form name="form" method="POST" action="RegistroServlet">
<table width="100%" border="0" align="center" cellspacing="12">
<%-- Login name --%>
<tr>
<th align="right" width="50%">
Nombre de usuario
</th>
<td align="left">
<input type="text" name="loginName" value="<jsp:getProperty name="loginForm" property="loginName"/>" size="16" maxlength="16">
<%= loginNameErrorMessage %>
</td>
</tr>
<tr>    
<th align="right" width="50%">
        Password
</th>
<td align="left">
    <input type="password" name="password" size="16" maxlength="16">
    <%= passwordErrorMessage %>
</td>    
</tr>
<tr>    
<th align="right" width="50%">
        Introduzca de nuevo el Password
</th>
<td align="left">
    <input type="password" name="password2" size="16" maxlength="16">
    <%= passwordErrorMessage %>
</td>    
</tr>

<%
        String url = (String) request.getHeader("referer");
%>
<input type="hidden" name="referer" value=<%=url%>>

<tr>
<td width="50%"></td>
<td align="left" width="50%">
<input type="submit" value="Registrar">
<%/*response.setHeader("Pragma", "no-cache");  
response.setHeader("Expires", "Sat, 6 May 1995 12:00:00 GMT");  
response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate");  
response.addHeader("Cache-Control", "post-check=0, pre-check=0");*/%>  
<a href="<%= response.encodeURL("ShowLogin.jsp")%>"><input type="button" value="Cancelar"></a></td>
</tr>
</table>
</form>
<UL>
</UL>
</BODY>
</HTML>